﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Project
{
    public class Camera
    {
        public Matrix view {get; set;}
        public Matrix projection {get; protected set;}
        private void recalculateProjection()
        {
            projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(fieldOfView), aspectRatio, 0.1f, 10000.0f);
        }
        float aspectRatio = 1.0f;
        float fieldOfView = 45.0f;
        public float AspectRatio
        {
            get
            {
                return aspectRatio;
            }
            set {
                aspectRatio = value;
                recalculateProjection();
            }
        }
        public float FieldOfView
        {
            get
            {
                return fieldOfView;
            }
            set {
                fieldOfView = value;
                recalculateProjection();
            }
        }

        public Camera(float aspectRatio, float fieldOfView)
        {
            this.AspectRatio = aspectRatio;
            this.FieldOfView = fieldOfView;
        }

        public Camera() : this(0.5f, 45.0f) {
    
        }
    }
}
